package org.mspring.mlog.utils;

import org.mspring.mlog.ServiceFactory;

/**
 * @author Gao Youbo
 * @since 2013-2-28
 */
public class PostUrlUtils {

    /**
     * 获取文章的相对路径
     *
     * @param postId
     * @return
     */
    public static String getPostRelativeUrl(long postId) {
        return "/post/" + postId + ".html";
    }

    /**
     * 获取文章的绝对路径
     *
     * @param postId
     * @return
     */
    public static String getPostAbsUrl(long postId) {
        return ServiceFactory.getConfigService().getConfig("siteurl") + getPostRelativeUrl(postId);
    }

}
